package asia.lics.system.service.impl;

import asia.lics.common.utils.DateUtils;
import asia.lics.system.domain.SysVipPackage;
import asia.lics.system.mapper.SysVipPackageMapper;
import asia.lics.system.service.ISysVipPackageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * VIP套餐Service业务层处理
 *
 * @author ss-tutor
 * @date 2024-12-01
 */
@Service
public class SysVipPackageServiceImpl implements ISysVipPackageService {
    @Autowired
    private SysVipPackageMapper sysVipPackageMapper;

    /**
     * 查询VIP套餐
     *
     * @param id VIP套餐主键
     * @return VIP套餐
     */
    @Override
    public SysVipPackage selectSysVipPackageById(Long id) {
        return sysVipPackageMapper.selectSysVipPackageById(id);
    }

    /**
     * 查询VIP套餐列表
     *
     * @param sysVipPackage VIP套餐
     * @return VIP套餐
     */
    @Override
    public List<SysVipPackage> selectSysVipPackageList(SysVipPackage sysVipPackage) {
        return sysVipPackageMapper.selectSysVipPackageList(sysVipPackage);
    }

    /**
     * 新增VIP套餐
     *
     * @param sysVipPackage VIP套餐
     * @return 结果
     */
    @Override
    public int insertSysVipPackage(SysVipPackage sysVipPackage) {
        sysVipPackage.setCreateTime(DateUtils.getNowDate());
        return sysVipPackageMapper.insertSysVipPackage(sysVipPackage);
    }

    /**
     * 修改VIP套餐
     *
     * @param sysVipPackage VIP套餐
     * @return 结果
     */
    @Override
    public int updateSysVipPackage(SysVipPackage sysVipPackage) {
        sysVipPackage.setUpdateTime(DateUtils.getNowDate());
        return sysVipPackageMapper.updateSysVipPackage(sysVipPackage);
    }

    /**
     * 批量删除VIP套餐
     *
     * @param ids 需要删除的VIP套餐主键
     * @return 结果
     */
    @Override
    public int deleteSysVipPackageByIds(Long[] ids) {
        return sysVipPackageMapper.deleteSysVipPackageByIds(ids);
    }

    /**
     * 删除VIP套餐信息
     *
     * @param id VIP套餐主键
     * @return 结果
     */
    @Override
    public int deleteSysVipPackageById(Long id) {
        return sysVipPackageMapper.deleteSysVipPackageById(id);
    }
}
